import java.util.Arrays;

/**
 * @author LKQ
 * @date 2021/12/10 17:06
 * @description 最垃圾的算法，ac勉强通过。
 */
public class Solution {
    public static void main(String[] args) {

    }

    public int singleNumber(int[] nums) {
        nums = Arrays.stream(nums).sorted().toArray();
        int n = nums.length, single = 0;
        for (int i = 0; i < n; ) {
            single = nums[i];
            if (i == n-1) {
                break;
            }
            if (single == nums[i+1]) {
                i = i + 2;
            }else {
                break;
            }
        }
        return single;
    }
}
